package top.huntwolf.admin.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.huntwolf.admin.common.JsonResult;
import top.huntwolf.admin.pojo.book.SaleBook;
import top.huntwolf.admin.service.BookService;

@Api(description = "卖书控制器")
@RestController
@CrossOrigin
@RequestMapping(value = "/saleBook")
public class SaleBookController {
    @Autowired
    private BookService bookService;

    @GetMapping("/{isbn}")
    public JsonResult<SaleBook> queryBook(@PathVariable String isbn) {

        SaleBook book = bookService.addSaleBookByISBN(isbn);
        return JsonResult.success(book);

    }
}
